package com.ruoyi.system.domain;

import com.fasterxml.jackson.annotation.JsonInclude;

import java.time.LocalDateTime;
import java.time.ZoneId;
import java.util.Date;
@JsonInclude(JsonInclude.Include.NON_NULL)
// DeviceView.java
public class DeviceView {
    private Long deviceId;
    private String deviceName;
    private Long deviceTypeId;
    private Date installationTime;
    private Date lastMaintenanceTime;
    private String status;
    private Double longitude;
    private Double latitude;
    private String province;
    private String city;
    private String location;
    private String mineName;

    // Getters and Setters
    // 添加 getter 方法
    public Long getDeviceId() {
        return deviceId;
    }

    public String getDeviceName() {
        return deviceName;
    }

    public Long getDeviceTypeId() {
        return deviceTypeId;
    }

    public LocalDateTime getInstallationTime() {
        return installationTime.toInstant()
                .atZone(ZoneId.systemDefault())
                .toLocalDateTime();
    }

    public LocalDateTime getLastMaintenanceTime() {
        return lastMaintenanceTime.toInstant()
                .atZone(ZoneId.systemDefault())
                .toLocalDateTime();
    }

    public String getStatus() {
        return status;
    }

    public Double getLongitude() {
        return longitude;
    }

    public Double getLatitude() {
        return latitude;
    }

    public String getProvince() {
        return province;
    }

    public String getCity(){return city;}

    public String getLocation(){return location;}

    public String getMineName() {
        return mineName;
    }
}